package com.pipidan.blog;

import com.pipidan.blog.util.MD5Utils;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

/**
 * @Author: runda
 * @CreateTime: 2022-11-20 19:33
 * @Description:
 */
//@RunWith(SpringRunner.class)
@SpringBootTest(classes = MyblogApplication.class)
public class test {
    @Autowired
//    @Resource(name = "RedisTemplate")
    private RedisTemplate redisTemplate;
//    @Autowired
//    private RedisTemplate redisTemplate;

    public static void main(String[] args) {
//        redisTemplate.opsForValue().set("123");
        String code = MD5Utils.code("123");
        System.out.println("code = " + code);
    }
    @Test
    public void  test1(){
        Object sun = redisTemplate.opsForValue().get("sun");
        System.out.println("sun = " + sun);
    }


}
